<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>原始着色器</title>
  <style>
    body {
      margin: 0;
      overflow: hidden;
    }
    canvas {
      outline: none;
    }
  </style>
</head>
<body>
  <script type="x-shader/x-vertex" id="vertexShader">
    precision mediump float;
    precision mediump int;

		uniform mat4 modelViewMatrix;
		uniform mat4 projectionMatrix;

    attribute vec3 position;
    attribute vec4 color;

    varying vec3 vPosition;
    varying vec4 vColor;

    void main () {
      vPosition = position;
      vColor = color;

      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
    }
  </script>

  <script type="x-shader/x-fragment" id="fragmentShader">
    precision mediump float;
    precision mediump int;

    uniform float time;

    varying vec3 vPosition;
    varying vec4 vColor;
    
    void main() {
      vec4 color = vec4(vColor);
      color.r += sin(vPosition.x * 10.0 + time) * 0.5;
      gl_FragColor = color;
    }
  </script>

  <script src="./_rowShader.js" type="module"></script>
</body>
</html>